#ifndef HERO_HH
#define HERO_HH

#include "ICharacter.hh"
#include "buffAndEffect.hh"
#include "randomFunc.hh"

// map<key, value> _map; map[key] = value;

//unsigned bleed = player.getPercent(hero::BLEED);
class Ahero : public ICharacter
{
protected:
    std::vector<unsigned> skill1_targets;
    std::vector<unsigned> skill2_targets;
    std::string name;
    std::string description;
    bool is_dead;
    bool is_dying;
    unsigned maxHealth;
    unsigned health;
    unsigned min_attack;
    unsigned max_attack;
    int speed;
    int round_speed;
    unsigned position_inteam;
    unsigned stress;
    // std::vector<buff_and_effect::Abuff> buffs;
    bool round_finsh;
    std::string skill1_description;
    std::string skill2_description;
    std::string skill1_name;
    std::string skill2_name;
    //以下属性为百分比
    unsigned crit;//暴击
    unsigned blight;//毒抗
    unsigned bleed;//血抗
    unsigned stun;//晕抗
    unsigned deathBlow;//死抗
    unsigned trap;//拆陷阱概率
    unsigned dodge;//闪避

public:
    Ahero();
    virtual ~Ahero() = default;
    Ahero(const Ahero& other);
    Ahero& operator=(const Ahero& other);
    
    bool isAlive() const override;
    void takeDamage(unsigned damage) override;
    void healing(unsigned healing_amount) override;
    void takeStress(unsigned stress_damage);
    void stressHealing(unsigned healing_amount);
    // void takeBuff(buff_and_effect::Abuff& buff) override;
    // void removeBuff(buff_and_effect::Abuff& buff) override;
    void modifyRoundSpeed(int new_speed) override;
    void sitRoundFinsh(bool b) override;
    void changePosInteam(unsigned new_pos) override;
    unsigned getSkillName() override;
    unsigned getskill1Target() override;
    unsigned getskill2Target() override;
    void changeAttack(int change_num);
    void changeSpeed(int change_num);
    virtual void skill1(std::vector<ICharacter*>& team, std::vector<ICharacter*>& other_team, unsigned target_pos) = 0;
    virtual void skill2(std::vector<ICharacter*>& team, std::vector<ICharacter*>& other_team, unsigned target_pos) = 0;
    // Getters
    std::string getName() const override;
    std::string getDescription() const override; 
    unsigned getMaxHealth() const override;
    unsigned getHealth() const override;
    unsigned getMinAttack() const;
    unsigned getMaxAttack() const;
    unsigned getSpeed() const override;
    int getRoundSpeed() const override;
    unsigned getPosInteam() const override;
    unsigned getStress() const;
    // std::vector<buff_and_effect::Abuff> getBuffs() const override;
    bool getRoundFinsh() const override;
    std::string getskill1_description() const; 
    std::string getskill2_description() const;
    std::string getskill1_name() const override; 
    std::string getskill2_name() const override;

    unsigned getCrit() const;
    unsigned getBlight() const override;
    unsigned getBleed() const override;
    unsigned getStun() const override;
    unsigned getDeathBlow() const;
    unsigned getTrap() const;
    unsigned getDodge() const;

    std::string toString() const override;
    // Operator overloads
    Ahero& operator-=(unsigned damage) override; // For taking damage
    Ahero& operator+=(unsigned healing_amount) override; //治疗 

    friend std::ostream& operator<<(std::ostream& os, const Ahero& hero);
    };

//实例化范类

#endif